package com.younio.local.util;

import lombok.Builder;
import lombok.Data;

/**
 * @desc:
 * @author: lan     [1728209643@qq.com]
 * @date: 2018-08-16 15:50
 */
@Data
@Builder
public class Result {

	private int code;

	private Object data;

	public static Result getInstance(int code, Object data) {
		return Result.builder().code(code).data(data).build();
	}

	public static Result getInstance(int code) {
		return getInstance(code, null);
	}

	public static Result OK(Object data) {
		return getInstance(200, data);
	}

	public static Result OK() {
		return getInstance(200, null);
	}

	public static Result FAILED(Object data) {
		return getInstance(400, data);
	}
}
